Skip to main content

Create Get channels Service

In this task, we create a Get Channels service that gets the details of all the Slack channels of a user from the Slack application.

Get channels Service

Get channels Service

If the Slack application is not integrated with the Backflipt platform, create the Slack integration first. To create the integration in the Backflipt platform, refer to Create Integration.

To Create a Get Channels Service

  1. Go to Integrations - IPAAS > Integrations dashboard.
  2. Go to the Slack integration. Then, click on the name of the integration.        
  3. Drag and drop the Http Client entity from the left pane to the canvas.
  4. Select the Http Client entity and update the properties panel.

    • In the Authenticate section, select the required Authentication.
      For more information on authentication and credentials, refer to Authentication and Credentials.
    • In the Operation section, select the operation as Http Call.               
      When you select an operation, the Backflipt platform automatically selects the latest version of the particular operation.
    • In the URL section, enter the URL as https://slack.com/api/conversations.list.
    • In the Method section, select the method as GET.
    • In the Query String section, select +Add Param to add the Key as Type and the Value as public_channel, private_channel, mpim, im
    • In the Content Type section, select the content type as Application JSON.
    • In the Response Type section, select the response type as JSON.
      The URL, Method, Query String, Content Type, and Response Type details used in this procedure are sourced directly from the Slack API documentation.
  1. Drag and drop the Loop entity from the left pane to the canvas below the Http Client entity.
  2. Select the Loop entity and update the properties panel.

  • In the Operation section, select the operation as Loop List.
  • In the Input section, under List, click the dropdown icon and select channels from the JSON Path.

    By default, the Index Handle is an index and the Item Handle is currentValue.

  1. Drag and drop the Object Helper entity from the left pane to the canvas below the Loop entity.
  2. Select the Object Helper entity and update the properties panel.

  • In the Operation section, select the operation as Add Key/Values.
  • In the Key/Value section, click +Add Key/Value to add the Key as a label and the Value as a name from the JSON Path.
  • In the Key/Value section, click +Add Key/Value again to add the Key as a Value and the Value as an id from the JSON Path.
  1. On the top pane of the canvas, click Schema and select Input to configure the input schema.
  2. In the Schema Editor dialog:

  • Select ADVANCED option.
  • Enter the Key and Label as Company.
  • In the UI Control dropdown, select the UI control method as Input.
  • Select OK.
  1. On the top pane of the canvas, click Schema and select Output to configure the output schema.
  2. In the Output Schema dialog:

       

  • Select the Type as Fixed type.
  • In the Sample Json Data, enter the below data.
    "[
     {
      "value": "C0198R46CRZ",
      "label": "flow"
     },
     {
      "value": "C019EQFE1FW",
      "label": "general"
     }
    ]"
  • Select OK.
  1. Select Save.
    The created service is added to the Slack integration.

Top of page